package dwei.ui
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	[Event(name="change", type="flash.events.Event")]
	public class UISize extends EventDispatcher
	{
//============================================================================
//PROPERTY
//============================================================================
		private var _minWidth:uint;
		private var _maxWidth:uint;
		private var _minHeight:uint;
		private var _maxHeight:uint;
		private var _verticalAlign:String;
		private var _horizontalAlign:String;
//============================================================================
//CONSTRUCTOR
//============================================================================
		public function UISize(
			minWidth:uint = 800, maxWidth:uint = 1024, minHeight:uint = 600, maxHeight:uint = 768, 
			horizontalAlign:String = "center", verticalAlign:String = "top")
		{
			_minWidth = minWidth;
			_maxWidth = maxWidth;
			_minHeight = minHeight;
			_maxHeight = maxHeight;
			_verticalAlign = verticalAlign;
			_horizontalAlign = horizontalAlign;
		}
//============================================================================
//GETTER/SETTER
//============================================================================

		public function get minWidth():uint
		{
			return _minWidth;
		}

		public function set minWidth(value:uint):void
		{
			if (value == _minWidth) return;
			_minWidth = value;
			dispatchEvent(new Event("change"));
		}

		public function get maxWidth():uint
		{
			return _maxWidth;
		}

		public function set maxWidth(value:uint):void
		{
			if (value == _maxWidth) return;
			_maxWidth = value;
			dispatchEvent(new Event("change"));
		}

		public function get minHeight():uint
		{
			return _minHeight;
		}

		public function set minHeight(value:uint):void
		{
			if (value == _minHeight) return;
			_minHeight = value;
			dispatchEvent(new Event("change"));
		}

		public function get maxHeight():uint
		{
			return _maxHeight;
		}

		public function set maxHeight(value:uint):void
		{
			if (value == _maxHeight) return;
			_maxHeight = value;
			dispatchEvent(new Event("change"));
		}

		public function get horizontalAlign():String
		{
			return _horizontalAlign;
		}

		public function set horizontalAlign(value:String):void
		{
			if (value == _horizontalAlign) return;
			_horizontalAlign = value;
			dispatchEvent(new Event("change"));
		}

		public function get verticalAlign():String
		{
			return _verticalAlign;
		}

		public function set verticalAlign(value:String):void
		{
			if (value == _verticalAlign) return;
			_verticalAlign = value;
			dispatchEvent(new Event("change"));
		}


	}
}